Skip to content

Make node_compat config migration lossless and strict - #216

Closed
noise64 wants to merge 6 commits into
mainfrom
strict-node-compat-migration
Closed

noise64 wants to merge 6 commits into
mainfrom
strict-node-compat-migration

Conversation

@noise64

@noise64 noise64 commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor
  • relates to GOL-1947 (first harness step; the 22.14.0 target is unchanged)
  • migrate_config_split keeps every entry's metadata (category, reason, flaky, timeout, nestedNodeTest, isolateBlockSubtests, split). It discovers .mjs files and never deletes an entry
  • when a split file's subtests changed, the migration requires the previous suite (NODE_COMPAT_MIGRATION_PREVIOUS_SUITE). A subtest keeps the metadata of the previous subtest with identical source, then of the one with the same name, then of the one with the same unique description. Matching by name alone put 50 unchanged 26.13.1 subtests with generated names (block_NN_block_NN) under another block's category. Changed generated-name subtests that keep metadata by position are listed under matchedByPosition
  • the migration writes a review report (target/node-compat-migration-report.json). It fails when an entry has a missing source, a removed subtest or a split/unsplit conflict that needs a decision
  • the config loader and the split runner now fail on configured entries without a vendored source. They no longer warn and skip
  • the split staleness check compares subtest names, not counts
  • removes 4 stale sequential/ http entries; their sources exist only under parallel/, where they are already configured as known gaps
  • renames 4 parallel/test-find-package-json.js subtests to the names discovered from the vendored source and keeps their categories
  • README and target-selection docs describe the strict migration workflow

Running the new migration on the current 22.14.0 suite would split 16 files and add 65 unevaluated .mjs files. That output is not applied here.

Node compatibility

From report.md generated on base 29f875e and on this head:

  • primary (CI-enforced): 3260/4451 → 3260/4447; passing is unchanged and the 4 removed entries were double-counted known gaps
  • full public: 3260/5810 → 3260/5806
  • http: 898 → 894 entries, 271 known gaps

Local checks: the head before a77af64 had migrate_config_split ':tag:migration_contract' 9/9, node_compat_report 36 passed/1 ignored, node_compat -- --list generates 6907 cases, node_compat parallel__test_find_package_json_js 7 passed/3 ignored, fmt and clippy (--all-targets -Dwarnings) clean.

On a77af64 (source matching): migrate_config_split ':tag:migration_contract' 11/11, clippy on that target clean, a 22.14.0 rerun is unchanged (16 split, 65 added, nothing to review), and the 22.14.0 → 26.13.1 run leaves 0 subtests whose metadata differs from the unchanged 22.14.0 subtest they run, down from 50. The other checks above were not rerun on a77af64.

On 85600f7 (review fix): unchanged same-name subtests skipped the matchedByPosition check, so a same-name generated subtest whose source changed ({ passes(1); } → { passes(2); }) kept its metadata without an entry. The check now runs before that shortcut. Classifications are unchanged. New contract test changed_blocks_with_unchanged_names_are_reported: fails on a77af64 (11 passed, 1 failed), passes on 85600f7 (12/12). Full migrate_config_split with the 22.14.0 suite 39/39, clippy on that target clean. On the real 22.14.0 → 26.13.1 run, matchedByPosition goes from 130 to 420 entries and the written config is byte-identical; the 22.14.0 rerun is unchanged. CI and the other checks above were not rerun on 85600f7.

On d37588e (explicit mapping decisions): a changed generated-name subtest matched by position keeps its previous metadata only as a proposal. Every such subtest, excluded ones included, stays under matchedByPosition and is also listed under pendingPositionDecisions with the hashes and previous metadata a decision must record. The run fails until each one has an accepted decision in NODE_COMPAT_MIGRATION_DECISIONS:

  • a decisions file must name the previous and current NODE_VERSION and the BLAKE3 hash of the input config's parsed tests object; otherwise the run fails before writing
  • each decision is bound to the BLAKE3 hash of both versions of the whole test file and to the previous raw entry, file metadata and effective category/reason/flaky (recomputed with the harness's category resolver, now pub). A mismatch leaves the subtest pending as stale or previousMismatch
  • a formerly runnable subtest that stops running, or a former known gap that leaves the primary surface, needs a baseline-gap, moved (to runnable or baseline-gap targets) or target-change (with evidence) obligation; accepted changes are listed under obligations
  • duplicate or malformed decisions fail the run, and decisions that match no pending subtest are listed under unusedDecisions and fail it
  • the hashes do not cover imported helpers, the harness or the parser. The tool checks shape and binding; the semantic audit of each decision is still manual

Checks on d37588e:

  • migrate_config_split ':tag:migration_contract' 23/23
  • red control: the 85600f7 tool with only the 4 new cases that use the old interface fails the 3 changed-block cases (runnable, node-internals and an unchanged entry that becomes node-internals); the identical-source move control passes
  • full migrate_config_split with the 22.14.0 suite 50/50
  • clippy -Dwarnings on migrate_config_split, agentic_ts, glue_benchmark, typescript_transform_latency, node_compat_report and node_compat_validate; fmt check clean

On the real 22.14.0 → 26.13.1 run:

  • without decisions it exits with all 420 matchedByPosition subtests pending (183 runnable, 59 known-gap, 148 node-internals, 25 wasi-impossible, 5 engine-difference)
  • the written config is byte-identical to 85600f7's output, and the other report keys are unchanged
  • a 3-row control decisions file leaves 418 pending (1 stale) and changes only the reclassified line. Repeating it from the same input gives identical output
  • the same decisions are rejected on the migrated config without a write
  • the 22.14.0 → 22.14.0 run reports no positional subtests and writes the same config as before

The 420 decisions themselves are not recorded here. CI and the other checks above were not rerun on d37588e.

On 1d4689c (review fix): a movedTo target was checked against the file entry's category even when the runner never runs that test. A changed runnable block could move its assertions to its own split parent, or to another split file, and be accepted while every subtest the runner selects there was excluded. A subtest listed under an excluded file that runs whole was accepted the same way. Targets now have to name the test the runner selects, matching tests/node_compat.rs: a file#subtest of a split file with subtests, otherwise the file. Other targets leave the decision pending with an obligationViolation.

  • new contract test moved_assertions_must_land_on_a_test_the_runner_selects: fails on d37588e (23 passed, 1 failed). On d37588e a probe showed all 4 rejected cases accepted and the 3 controls accepted (runnable split subtest, runnable whole file, baseline-gap subtest)
  • on 1d4689c: migrate_config_split ':tag:migration_contract' 24/24, full migrate_config_split with the 22.14.0 suite 51/51, clippy -Dwarnings on that target and fmt check clean
  • the real 22.14.0 → 26.13.1 runs give byte-identical configs and reports to d37588e (420 matchedByPosition, 420 pending without decisions; the same 3-row control and repeat; rejection on the migrated config without a write); the 22.14.0 → 22.14.0 run is unchanged

CI and the other checks above were not rerun on 1d4689c.

noise64 commented Nov 18, 2026

Copy link
Copy Markdown
Contributor Author

Folded into #218, which now targets main and contains this branch at 1d4689c, so the Node 26 harness, helpers and target switch are reviewed and merged as one PR. Closing in favour of #218; the branch is kept.

@noise64 noise64 closed this Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant